<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>

    <script>
        let number=19;
       let person={
            name:'张三',
           sex:'男',
       }
       Object.defineProperty(person,'age',{
           //当有人读取person的age属性时get函数就会被调用，且返回age的值
           get:function (){
                return number;
           }
       })
        console.log(person)
    </script>
</body>
</html>